<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="image/png">

  <title>文件上传</title>

    <div th:include="commons :: comhead"></div>

    <!--这是js-->
    <script>
        function checkfile(f) {
            var context = f.myFile.value;
            if (context!==""){
                if(f.receiveId.value!=0) {
                    return  true;
                }else{
                    alert("请选择接收人！");
                    return  false;
                }
            } else {
                alert("请选择需要上传的文件")
                return false;
            }
        }
    </script>
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div th:replace="commons :: #left"></div>
    <!-- left side end-->
    
    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <div th:replace="commons :: #search"></div>
        <!-- header section end-->

        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                文件
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">主页</a>
                </li>
                <li>
                    <a href="#">文件管理</a>
                </li>
                <li class="active">上传文件</li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <section class="wrapper">
        <!-- page start-->
        <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
                文件上传！！！
            </header>
            <div class="panel-body">
                <form class="form-horizontal adminex-form" th:action="@{/upload}" method="post" enctype="multipart/form-data" onsubmit="return checkfile(this)">
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">接收者</label>
                        <div class="col-sm-10">
                            <select class="form-control tooltips" name="receiveId">
                                <option value="0">请选择接收人</option>
                                <option th:each="ename:${enamList}" th:value="${ename.id}" th:text="${ename.ename}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-2 control-label">文件上传</label>
                        <div class="col-lg-10">
                            <input type="file" id="exampleInputFile" name="myFile">
                            <p class="help-block">不得超过10M</p>
                        </div>
                    </div>
<!--                    <div class="form-group">-->
<!--                        <label for="exampleInputFile">文件上传</label>-->
<!--                        <input type="file" id="exampleInputFile" name="myFile">-->
<!--                        <p class="help-block">不得超过10M</p>-->
<!--                    </div>-->
                    <div>
                        <input class="btn btn-success btn-lg btn-block" type="submit"></input>
                    </div>
                </form>
            </div>
        </section>
        </div>
        <!-- page end-->
        </section>
        <!--body wrapper end-->

        <!--footer section start-->
        <footer>
            2020 &copy; AdminEx by ThemeBucket </a>
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<div th:include="commons :: js"></div>

<!--common scripts for all pages-->

</body>
</html>
